﻿{extend name="common/mask" /}
	{block name="main"}
    	<!-- 内容主体区域 -->
	  	<div class="layui-tab layui-tab-brief" lay-filter="demoTitle">
			<div class="layui-tab-content site-demo site-demo-body">
			  <div class="layui-tab-item layui-show">
				<div class="layui-main">
				  <div id="LAY_preview">
				  
				<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
					<legend>编辑</legend>
				</fieldset>
					<form class="layui-form" action="__ROOT__/admin/Service/edit" method="post" lay-filter="sub">
						<input type="hidden" name="flag" value="{$flag}">
					  {volist name="fields" id="vo"}
					  
					  
					  <div class="layui-form-item">
						<label class="layui-form-label">{$vo.fieldsname}</label>
						<div class="layui-input-block">
							{if condition="$vo.fields eq 'id'"}
							<input type="text" name="{$vo.fields}" value="{$vo.value}" autocomplete="off" class="layui-input" readonly>
							{else/}
							<input type="text" name="{$vo.fields}" value="{$vo.value}" autocomplete="off" class="layui-input">
							{/if}
						  
						</div>
					  </div>
					 
					  {/volist}
					<div class="layui-form-item">
						<div class="layui-input-block">
					<input type="submit" value ="提交" class="layui-btn" lay-submit="" lay-filter="demo1" >
					    </div>
					</div>
					</form>
					
			</div>
          </div>
        </div>
      </div>
	  <script>
		layui.use('form', function(){
		  var form = layui.form;
		  
			  form.on('submit(sub)', function(data){
				 console.log(data.elem) //被执行事件的元素DOM对象，一般为button对象
				 console.log(data.form) //被执行提交的form对象，一般在存在form标签时才会返回
				 console.log(data.field) //当前容器的全部表单字段，名值对形式：{name: value}
				 
			  
			});
		});
		
	  </script>
	{/block}